package org.example.democode.movierental;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author liyishan
 * @date 2023/6/8 09:58
 * @apiNote
 */
@Data
@NoArgsConstructor
public class Rental {

    /**
     * 租的电影
     */
    private Movie movie;

    /**
     * 已租天数
     */
    private int daysRented;

    public Rental(Movie movie, int daysRented) {
        this.movie = movie;
        this.daysRented = daysRented;
    }
    public Movie getMovie() {
        return movie;
    }


    public int getPoint() {
        return this.movie.getPoint(this.daysRented);
    }

    /**
     * 获取费用
     *
     * @return
     */
    public double getCharge() {
        return this.movie.getCharge(this.daysRented);
    }

}
